﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using ChuckNorris.Models;
using ChuckNorris.ViewModels;
using ImpromptuInterface.MVVM;
using ImpromptuInterface.MVVM.TinyIoC;
using TinyIoC;

namespace ChuckNorris.TinyIOC
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var tinyContainer = new TinyIoCContainer();
            tinyContainer.Register<IWebService>(new ChuckNorrisWebService());

            var impromptuContainer = new Container(tinyContainer);
            impromptuContainer.AddView("Main", typeof(MainView), typeof(MainViewModel));

            var runtime = Runtime.Initialize().SetupContainer(impromptuContainer);
            runtime.Start.Main();

        }
    }
}
